#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "base.h"
#include "common.h"

#include <QMainWindow>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

enum ScreenScale {
    WTH16X10,
    WTH16X9,
    WTH4X3,
};

class Base;
class AgreementDialog;
class RebootUI;
class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void paintEvent(QPaintEvent *pEvent);

public slots:
    void hideCentralContent();
    void showCentralContent();

    void hideCurrentStepContent();
    void showCurrentStepContent();

    void showAgreementDialog(int ty, bool state);
    void onAgreeStateChanged(int state);

signals:
    void currentPageChanged(int index);

private slots:
    void on_preview_Btn_released();
    void on_next_Btn_released();
    void on_exit_Btn_released();
    void onCurrentPageChanged(int index);

    void onUpdateCheckState(CheckState state);
    void onContinueReboot();
    void onRebootCbx(int index);

private:
    void initPages();
    void changePage();
    void showRebootUI();

    Ui::MainWindow *ui;

    ScreenScale m_screenScale;
    QString m_bg;
    QList<Base*> m_pages;
    int m_currentPageIndex;

    // page 1
    AgreementDialog *m_agreementDialog;

    // page 2
    CheckState m_checkState = UNCHECKED;

    // page 7
    RebootUI *m_rebootUI;

};
#endif // MAINWINDOW_H
